package com.yanyeori.rabbitmqconsumer.receiver;

import com.yanyeori.framework.core.util.JacksonUtil;
import com.yanyeori.rabbitmqconsumer.constant.RabbitmqConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author chenkuan
 * @version v1.0
 * @desc 扇型B -- 消息接收监听类
 * @date 20/7/30 030 16:23
 */
@Service
@RabbitListener(queues = RabbitmqConfig.FANOUT_QUEUE_B)
public class FanoutReceiverB {
    private static final Logger logger = LoggerFactory.getLogger(FanoutReceiverB.class);

    @RabbitHandler
    public void process(Map<String, Object> message) {
        logger.info("FanoutReceiverB消费者收到消息=[{}]", JacksonUtil.toJson(message));
    }
}
